
#ifndef FREY_FUNCTIONS_GUARD
#define FREY_FUNCTIONS_GUARD 1 

#include <algorithm> 
#include <functional> 
#include <cctype>
#include <locale>


// trim from start
static inline std::wstring & wtrimLeft(std::wstring &s) {
	s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not1(std::ptr_fun<int, int>(std::isspace))));
	return s;
}

// trim from end
static inline std::wstring & wtrimRight(std::wstring &s) {
	s.erase(std::find_if(s.rbegin(), s.rend(), std::not1(std::ptr_fun<int, int>(std::isspace))).base(), s.end());
	return s;
}

// trim from both ends
static inline std::wstring & wtrim(std::wstring &s) {
	return wtrimLeft(wtrimRight(s));
}


#endif   //FREY_FUNCTIONS_GUARD